

class DBaseScene extends DBasePannel{
    public PANNELS:DBasePannel[] = [];
    

    constructor(){
        super();
    }

    public async start(onProcess?:Function){
        let needs = [];
        for(let i = 0; i < this._RES.length; i ++){
            needs.push(this._RES[i]);
        }
        
        for(let i = 0; i < this.PANNELS.length; i ++){
            let pannel = this.PANNELS[i];
            for(let j = 0; j < pannel._RES.length; j ++){
                needs.push(pannel._RES[j]);
            }
        }
        if(needs.length > 0){
            await DResMgr.load(needs, onProcess, this);
            this.enterInit();
        }else{
            this.enterInit();
        }
    }

    private async enterInit(){
        this.delayInit();
        for(var i = 0; i < this.PANNELS.length; i ++){
            let pannel = this.PANNELS[i];
            await pannel.preStart();
        }
    }

}
